<div id="create-post">
	<script type="text/javascript">
		$(document).ready(function() {
			function reset() {
				$('#show-title-comment').hide();
				$("#upload").hide();
				$("#show-title").attr('checked', false);
				$('#content').hide();
				$('#source-label-comment').hide();
				$('#upload-label p').html('');	
				$('#content-label p').html('treść:');
				$('#content-input').height(200);
			}
			
			function select(what) {
				reset();
				$('.selected').removeClass('selected');
				$(what).addClass("selected");
				$('#type-input').val(what.substr(1)); //
				switch(what) {
					case '#<?php echo Post::TYPE_IMAGE; ?>':
						$("#show-title").attr('checked', true);
					case '#<?php echo Post::TYPE_IMAGE; ?>':
						$('#upload').show();
						$('#upload-label p').html('zdjęcie:');
						$('#content-label p').html('opis:');
						$('#content-input').height(40);
						$('#content').show();
						break;
					case '#<?php echo Post::TYPE_ARTICLE; ?>':
					case '#<?php echo Post::TYPE_QUOTE; ?>':
						$("#show-title").attr('checked', true);
						$('#content').show();
						break;
					case '#<?php echo Post::TYPE_MOVIE; ?>':
						$('#source-label-comment').show();
						$("#show-title").attr('checked', false);
						break;
				}
			}
			
			select('#<?php echo Post::TYPE_IMAGE; ?>');
			
			$('#post-type li').click(function() {
				select('#' + $(this).attr("id"));
			});
			
			$("#show-title").mouseover(function() {
				$('#show-title-comment').show();
			});
			
			$("#show-title").mouseout(function() {
				$('#show-title-comment').hide();
			});
		});
	</script>
	<form id="create-post-form" enctype="multipart/form-data" action="<?php URI::theUrl('create', $this->data->loggedUserName, 'add'); ?>" method="post">
		<ul id="post-type">
			<li id="<?php echo Post::TYPE_IMAGE; ?>">Zdjęcie</li>
			<li id="<?php echo Post::TYPE_ARTICLE; ?>">Artykuł</li>
			<li id="<?php echo Post::TYPE_QUOTE; ?>">Cytat</li>
			<li id="<?php echo Post::TYPE_MOVIE; ?>">Film</li>
			<li id="<?php echo Post::TYPE_CSS; ?>">Styl Css</li>
		</ul>	
		<div id="title" class="wrapper">
			<div id="title-label" class="label"><p>tytuł: </p></div>
			<input type="text" name="title" size="40" class="input" id="title-input">
			<!--<div id="show-title-label" class="label"><p>wyświetl tytuł</p></div>-->
			<input type="checkbox" name="showTitle" id="show-title" value="show" checked="checked" />
			<div id="show-title-comment">Pokaż tytuł</div>
		</div>
		<div id="upload"  class="wrapper">
			<div id="upload-label" class="label"><p></p></div>
			<input type="file" name="file" size="40" class="input">
		</div>
		<div id="content" class="wrapper">
			<div id="content-label" class="label"><p>treść: </p></div>
			<textarea name="content" class="input" id="content-input"></textarea>
		</div>
		<div id="source" class="wrapper">
			<div id="source-label" class="label" ><p>źródło<span id="source-label-comment"> (link do youtube)</span>: </p></div>
			<input type="text" name="source" size="40" class="input">
		</div>
		<div id="tags" class="wrapper">
			<div id="tags-label" class="label"><p>tagi: </p></div>
			<input type="text" name="tags" size="40" class="input">
		</div>
		<div id="own" class="wrapper"><div class="label"><p>oznacz jako własny: </p></div><input type="checkbox" name="own" id="own-checkbox" value="isAuthor" /></div>
		<input type="hidden" name="type" id="type-input" />
		<input type="submit" value="Dodaj" />
	</form>
</div>